package p.ithorns.integration.hazelcast.mqtt;

import com.hazelcast.core.HazelcastInstance;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * LocateHandler
 * TODO ithorns
 *
 * @author Ht.L
 * @date 2023-11-20 17:30
 * @since 1.0.0
 */
@Slf4j
@Service
public class LocateHandler extends AbstractDataHandler<Payload> {

    private final String member;

    public LocateHandler(HazelcastInstance hz) {
        this.member = hz.getCluster().getLocalMember().toString();
    }

    @Override
    public void handle(Payload payload) {
        log.info("[{}] ====> 开始处理：{}", member, payload);
    }

    @Override
    public Serializable getCode() {
        return UpMsgType.LOCATE;
    }
}